<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<div class="row">
	<div class="col-lg-12 col-sm-12 col-xs-12">
		<div class="widget">
			<div class="widget-header bordered-bottom theme">
				<span class="widget-caption">操作权限-${(editModel=='add')?string('新增','编辑')}</span>
				<div class="widget-buttons">
					<a href="#" data-toggle="collapse">
						<i class="fa fa-minus"></i>
					</a>
					<a href="#" data-toggle="maximize">
						<i class="fa fa-expand"></i>
					</a>
				</div>
			</div>
			<div class="widget-body">
				<div class="row">
					<form class="editForm" action="${saveUrl}" method="post" responseType="JSON" role="form" id="editForm_${serializeNum}"
						data-bv-submitButtons="#editFormSubmitBtn_${serializeNum}"
						data-bv-message="This value is not valid"
						data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
						data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
						data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
						<input type="hidden" name="formKey" value="${formKey}">
						<input type="hidden" name="formToken" value="${formToken}">
							<input type="hidden" name="id" value="${editEntity.id}">
							<#if (true && editModel=='add')||(false && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4">
								<div class="form-group">
									<label for="adminUserPermissionAllotId" class="col-sm-2 control-label no-padding-right">设置对象</label>
									<div class="col-sm-10">
										<select id="setObj" class="selectpicker_${serializeNum}" data-live-search="true">
										<optgroup label="选择所属分组" data-icon="icon-ok">
											<option value="role">角色</option>
											<option value="admin">管理员</option>
										</optgroup>
										</select>
										<script type="text/javascript">
											$(function(){
												$("#obj_admin").hide();//默认设置对象为角色,固件管理员的下拉框隐藏
												$("#setObj").change(function(){
													if(this.value=="role"){
														$("#obj_admin").hide();
														$("#obj_role").show();
													}else if(this.value=="admin"){
														$("#obj_admin").show();
														$("#obj_role").hide();
													}
												});
											});
										</script>
									</div>
								</div>
							</div>
							</#if>
							<#if (true && editModel=='add')||(false && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4" id="obj_admin">
								<div class="form-group">
									<label for="adminUserPermissionAllotId" class="col-sm-2 control-label no-padding-right">管理员->菜单</label>
									<div class="col-sm-10">
										<select name="adminUserPermissionAllotId" class="selectpicker_${serializeNum}" data-live-search="true">
										<optgroup label="选择所属分组" data-icon="icon-ok">
											<option value="">无</option>
											<#list adminUserPermissionAllotId_datasources as datasources >
											<option value="${datasources.id}">${datasources.userName}->${datasources.menuName}</option>
											</#list>
										</optgroup>
										</select>
										<script type="text/javascript">
											$("[name='adminUserPermissionAllotId']").val("${editEntity.adminUserPermissionAllotId}");
										</script>
									</div>
								</div>
							</div>
							</#if>
							<#if (true && editModel=='add')||(false && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4" id="obj_role">
								<div class="form-group">
									<label for="rolePermissionAllotId" class="col-sm-2 control-label no-padding-right">角色->菜单</label>
									<div class="col-sm-10">
										<select name="rolePermissionAllotId" class="selectpicker_${serializeNum}" data-live-search="true">
										<optgroup label="选择所属分组" data-icon="icon-ok">
											<option value="">无</option>
											<#list rolePermissionAllotId_datasources as datasources >
											<option value="${datasources.id}">${datasources.roleName}->${datasources.menuName}</option>
											</#list>
										</optgroup>
										</select>
										<script type="text/javascript">
											$("[name='rolePermissionAllotId']").val("${editEntity.rolePermissionAllotId}");
										</script>
									</div>
								</div>
							</div>
							</#if>
							<#if (true && editModel=='add')||(true && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4">
								<div class="form-group">
									<label for="name" class="col-sm-2 control-label no-padding-right">权限名称</label>
									<div class="col-sm-10">
										<input data-bv-message="The field is not valid"maxlength="50" name="name" alt="权限名称" id="name" placeholder="权限名称" type="text" title="权限名称" class="form-control"  value="${editEntity.name}" />
										<span class="text"></span>
									</div>
								</div>
							</div>
							</#if>
							<#if (true && editModel=='add')||(true && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4">
								<div class="form-group">
									<label for="pageName" class="col-sm-2 control-label no-padding-right">页面名称</label>
									<div class="col-sm-10">
										<input data-bv-message="The field is not valid"maxlength="200" name="pageName" alt="页面名称" id="pageName" placeholder="页面名称" type="text" title="页面名称" class="form-control"  value="${editEntity.pageName}" />
										<span class="text"></span>
									</div>
								</div>
							</div>
							</#if>
							<#if (true && editModel=='add')||(true && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4">
								<div class="form-group">
									<label for="code" class="col-sm-2 control-label no-padding-right">权限编码</label>
									<div class="col-sm-10">
										<input data-bv-message="The field is not valid"maxlength="100" name="code" alt="权限编码" id="code" placeholder="权限编码" type="text" title="权限编码" class="form-control"  value="${editEntity.code}" />
										<span class="text"></span>
									</div>
								</div>
							</div>
							</#if>
							<#if (true && editModel=='add')||(true && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4">
								<div class="form-group">
									<label for="tagName" class="col-sm-2 control-label no-padding-right">标签名</label>
									<div class="col-sm-10">
										<input data-bv-message="The field is not valid"maxlength="20" name="tagName" alt="标签名" id="tagName" placeholder="标签名" type="text" title="标签名" class="form-control"  value="${editEntity.tagName}" />
										<span class="text"></span>
									</div>
								</div>
							</div>
							</#if>
							<#if (true && editModel=='add')||(true && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4">
								<div class="form-group">
									<label for="innerHtml" class="col-sm-2 control-label no-padding-right">内部html</label>
									<div class="col-sm-10">
										<input data-bv-message="The field is not valid"maxlength="2000" name="innerHtml" alt="内部html" id="innerHtml" placeholder="内部html" type="text" title="内部html" class="form-control"  value="${editEntity.innerHtml?html}" />
										<span class="text"></span>
									</div>
								</div>
							</div>
							</#if>
							<#if (true && editModel=='add')||(true && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4">
								<div class="form-group">
									<label for="idAttr" class="col-sm-2 control-label no-padding-right">ID属性</label>
									<div class="col-sm-10">
										<input data-bv-message="The field is not valid"maxlength="500" name="idAttr" alt="ID属性" id="idAttr" placeholder="ID属性" type="text" title="ID属性" class="form-control"  value="${editEntity.idAttr}" />
										<span class="text"></span>
									</div>
								</div>
							</div>
							</#if>
							<#if (true && editModel=='add')||(true && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4">
								<div class="form-group">
									<label for="weight" class="col-sm-2 control-label no-padding-right">权重</label>
									<div class="col-sm-10">
										<input  data-bv-integer-message="The field is number" data-bv-message="The field is not valid" data-bv-integer="true"maxlength="11" name="weight" alt="权重" id="weight" placeholder="权重" type="text" title="权重" class="form-control"  value="${editEntity.weight}" />
										<span class="text"></span>
									</div>
								</div>
							</div>
							</#if>
							<#if (true && editModel=='add')||(true && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4">
								<div class="form-group has-feedback">
									<label for="isForbidden" class="col-sm-2 control-label no-padding-right">是否禁用</label>
									<div class="col-sm-10">
										<input type="hidden" name="isForbidden" value=${(editEntity.isForbidden???string(editEntity.isForbidden?string('true','false'),'false'))!'false'}>
										<label>
											<input data-target-input-name="isForbidden" data-bv-message="The field is not valid"maxlength="1" alt="是否禁用" id="isForbidden" placeholder="是否禁用" type="checkbox" title="是否禁用" class="form-control checkbox-slider slider-icon yesno"  ${(editEntity.isForbidden???string(editEntity.isForbidden?string('checked',''),''))!''}>
											<span class="text"></span>
										</label>
									</div>
								</div>
							</div>
							</#if>
							<#if (false && editModel=='add')||(false && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4">
								<div class="form-group">
									<label for="createTime" class="col-sm-2 control-label no-padding-right">创建时间</label>
									<div class="col-sm-10">
										<span class="input-icon icon-left">
											<input data-bv-date-format="YYYY-MM-DD hh:mm:ss" data-bv-message="The field is not valid" data-bv-date-message="请正确输入一个时间" data-bv-date="true"maxlength="19" name="createTime" alt="创建时间" id="createTime" placeholder="创建时间" type="text" title="创建时间" class="form-control form-control date-picker" onfocus="WdatePicker({doubleCalendar:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})"  value="${editEntity.createTime}"/>
											<i class="fa fa-calendar"></i>
										</span>
									</div>
								</div>
							</div>
							</#if>
							<#if (false && editModel=='add')||(false && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4">
								<div class="form-group">
									<label for="createUserId" class="col-sm-2 control-label no-padding-right">创建人Id</label>
									<div class="col-sm-10">
										<input data-bv-message="The field is not valid"maxlength="32" name="createUserId" alt="创建人Id" id="createUserId" placeholder="创建人Id" type="text" title="创建人Id" class="form-control"  value="${editEntity.createUserId}" />
										<span class="text"></span>
									</div>
								</div>
							</div>
							</#if>
							<#if (false && editModel=='add')||(false && editModel=='edit')>
							<div class="col-xm-12 col-sm-6 col-lg-4">
								<div class="form-group">
									<label for="version" class="col-sm-2 control-label no-padding-right">版本</label>
									<div class="col-sm-10">
										<input  data-bv-integer-message="The field is number" data-bv-message="The field is not valid" data-bv-integer="true"maxlength="11" name="version" alt="版本" id="version" placeholder="版本" type="text" title="版本" class="form-control"  value="${editEntity.version}" />
										<span class="text"></span>
									</div>
								</div>
							</div>
							</#if>
						<div class="col-sm-12">
							<input type="button" class="btn btn-default" data-dismiss="modal" value="返回" onclick="backView()"/>
							<button type="submit" class="btn btn-blue" id="editFormSubmitBtn_${serializeNum}">保存</button>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
<script src="assets/js/validation/bootstrapValidator_init.js"></script>
<script>
$(".selectpicker_${serializeNum}").select2();
</script>